package com.yape;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import javax.annotation.Resource;
import com.yape.dao.CrawlerTaskMapper;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author yape
 * @description
 * @date 2025/5/20 16:08
 */
@SpringBootApplication
@Configurable
public class Application {
    @Resource
    private CrawlerTaskMapper crawlerTaskMapper;

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Bean
    public CommandLineRunner resetRunningOnStartup() {
        return args -> {
            crawlerTaskMapper.resetAllRunning();
        };
    }
}